package com.greensam.pixelengine.websocket.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 图片编辑动作枚举
 *
 * @author Ma Chengrui
 * @since 2025/10/10 16:52
 */
@Getter
@AllArgsConstructor
public enum PictureEditActionEnum {

    ZOOM_IN("ZOOM_IN", "放大"),
    ZOOM_OUT("ZOOM_OUT", "缩小"),
    ROTATE_LEFT("ROTATE_LEFT", "左旋转"),
    ROTATE_RIGHT("ROTATE_RIGHT", "右旋转"),
    ;

    private final String code;
    private final String desc;

    public static PictureEditActionEnum fromCode(String code) {
        for (PictureEditActionEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
